CUBE CONNECT Edition Help

Theory

This section describes the theory used by the Network program. Topics include:

Phase descriptions

Network Topology Functions

Variable referencing

Output variables

Plotting

Phase descriptions

The program processes the input files in separate phases, which are listed below. For most applications, the user need not be concerned with process phases; they are used only when special processing is to be undertaken. In general, the user must code operational statements within a PROCESS PHASE block defined for each phase. There may be only one block for each phase, and the order of the blocks in the input is not crucial. It is suggested that for readability and ease of editing, the phase blocks be defined in the normal process order. Only statements that specifically apply to the phase should be coded within the block. However, statements that are not dynamic operations, but that appear within a phase block will be recognized as such and will be processed properly. A block should be terminated with an ENDPROCESS statement. If another PROCESS PHASE statement is encountered before an ENDPROCESS statement, the previous block is terminated, and the new block is begun.

The basic phases are:

  • INPUT phase — Read ASCII, Network, GIS and DBF files, re-code values from any input files specifically designated.
  • NODEMERGE phase — Read all node data and organize it
  • LINKMERGE phase — Read all link data and process it (main phase)
  • SUMMARY phase — Report results of LINKMERGE phase

There need not be a specific PROCESS PHASE for LINKMERGE, because it is anticipated that most applications will be functioning in only this phase. If an operational statement is encountered, and it is not within a PROCESS block, it is tagged as being in the LINKMERGE phase. A PROCESS PHASE=LINKMERGE statement may be coded, but it is not mandatory.

Internally, the program processes the phases in the order in which they are described below. As it processes each phase, it determines the files that must be processed in that phase, and processes them. If there are no relevant files for an INPUT phase, the phase is bypassed. As the program processes each file record, it applies any phase operations that the user has designated for the phase.

INPUT phase

All ASCII, Network, GIS and DBF files must pass through this phase. The records are processed and edited for errors and duplication. The user may specify selections and computations to be applied to each record as it is processed. It is possible to re-code node numbers in this phase. Binary input files are processed in this phase only if the user has specifically designated the file through the use of a PROCESS PHASE=INPUT block. Any file (or file segment) that passes through this phase, is no longer used in its original format after this phase is completed; but its data are used in subsequent phases in a revised internal format. The file segment records are sorted in appropriate order (node or link) before being stored in the revised format.

NODEMERGE phase

The node based records from all the NODEI files must pass this phase. As in the INPUT phase, the user may specify computations and/or selections to be applied to each node record as it is processed. It is not permissible to re-code node numbers in this phase. The resulting record for each unique node is written to the output network, and saved for subsequent referencing in the LINKMERGE phase.

NODEMERGE Phase Keywords - network topology.

  • _N.MaxConnect - Get maximum number of connections for the whole network.
  • _N.Connections - Get number of connecting nodes to N.
  • _N.Legs - Get number of legs at N.
  • _N.Inbounds - Get number of inbound links to N.
  • _N.Outbounds - Get number of outbound links to N.
  • _NI.{name}[#] - Get inbound link attribute’s value, {name} is the attribute name, [#] is the leg number.
  • _NO.{name}[#] - Get outbound link attribute’s value, {name} is the attribute name, [#] is the leg number.
  • _NI._Angle[#] - Get inbound link angle in degrees, # is the leg number.
  • _NI._R_ANGLE[#] - Get inbound link angle relative to the current leg, in degrees. [#] is the leg number. In the node merge phase, the current leg is always the first leg in the A/B sort sequence.
  • _NO._Angle[#] - Get outbound link angle in degrees, # is the leg number.
  • _NO._R_ANGLE[#] - Get outbound link angle relative to the current leg, in degrees. [#] is the leg number. In the node merge phase, the current leg is always the first leg in the A/B sort sequence.

See Network Topology Functions for more information.

LINKMERGE phase

The link based records from all the LINKI files must pass through this phase. As in the above phases. the user may specify selections and computations to each link record as it is processed. This is the phase that most users are mostly interested in. Records can be deleted, summarized, tabulated, and extracted to an external device or file. Node based data can be accessed during the link processing. Tabulated and summarized data is reported at the end of the phase, and, in most cases, passed onto the final phase.

LINKMERGE Phase Keywords - network topology.

  • _N.MaxConnect - Get maximum number of connections for the whole network.
  • _A.MAXMOVELEGS/ _B.MAXMOVELEGS - Variable which contains the highest number of legs per movement, in both inbound and outbound direction at the A/B node. If this value is greater than 1, it means that more than one leg at the A/B node location has the same movement..
  • _A.Connections/_B.Connections - Get number of connecting nodes to A/B.
  • _A.Legs/_B.Legs - Get number of legs at A/B.
  • _A.Inbounds/_B.Inbounds - Get number of inbound links at A/B.
  • _A.Outbounds/_B.Outbounds - Get number of outbound links at A/B.
  • _A.CurrentLeg/_B.CurrentLeg - Get the leg number of the current link at A/B.
  • _AI.{name}[#]/_BI.{name}[#] - Get inbound link attribute’s value, {name} is the attribute name, [#] is the leg number at A/B.
  • _AO.{name}[#]/_BO.{name}[#] - Get outbound link attribute’s value, {name} is the attribute name, [#] is the leg number at A/B.
  • _L.S_Angle - Get link angle for the current link, at the start of the link. The angle is calculated in degrees. Zero is north and counted counter-clockwise. For straight line links, the _L.S_Angle and _L.E_Angle both have the same values. Only if a GEOMI shape file is input and the parameter SHAPEANGLE set to true, _L.S_Angle and _L.E_Angle will give different values for links with shapes.
  • _L.E_Angle - Get link angle for the current link, at the end of the link. The angle is calculated in degrees. Zero is north and counted counter-clockwise. For straight line links, the _L.S_Angle and _L.E_Angle both have the same values. Only if a GEOMI shape file is input and the parameter SHAPEANGLE set to true, _L.S_Angle and _L.E_Angle will give different values for links with shapes.
  • _AI._Angle[#]/_BI._Angle[#] - Get inbound link angle in degrees, [#] is the leg number at A/B.
  • _AI._R_ANGLE[#]/ _BI._R_ANGLE[#] - Get inbound link angle relative to the current link, in degrees. [#] is the leg number. The inbound relative angles are calculated to be the relative angles of the inbound legs with the OUTBOUND leg of the subject link.
  • _AI._MOVE[#]/_BI._MOVE[#] - Get the movement number of an inbound leg relative to the current leg. [#] is the leg number. The movements are determined based on the relative angle. For inbound legs, it is the direction it is turning FROM, meaning if it is FROM the right, it is a LEFT turn from that leg into the current leg. The movement numbers are defined as:
    • 0 - Current leg
    • 1 - Right (45 to 135 degrees)
    • 2 - Through (135 to 225 degrees)
    • 3 - Left (225 to 315 degrees)
    • 4 - U-turn (0-45 and 315-360 degrees)
  • _AO._MOVE[#]/_BO._MOVE[#] - Get the movement number of an out bound leg relative to the current leg. [#] is the leg number. The movements are determined based on the relative angle. For outbound legs, it is the direction it is turning to, meaning if it is TO the right, it is a RIGHT turn from the current leg to that leg. The movement numbers are defined as:
    • 0 - Current leg
    • 1 - Right (45 to 135 degrees)
    • 2 - Through (135 to 225 degrees)
    • 3 - Left (225 to 315 degrees)
    • 4 - U-turn (0-45 and 315-360 degrees)
  • _AO._Angle[#]/_BO._Angle[#] - Get outbound link angle in degrees, [#] is the leg number at A/B.
  • _AO._R_ANGLE[#]/_BO._R_ANGLE[#] - Get outbound link angle relative to the current link, in degrees. [#] is the leg number. The outbound relative angles are calculated to be the relative angles of the outbound legs with the INBOUND leg of the subject link.

See Network Topology Functions for more information.

SUMMARY phase

In this phase, certain post-processing operations can be performed. This is generally restricted to computations on working variables, usually to obtain averages, etc.

Every record is processed according to the purpose of the current phase. If there are operations to be performed in the phase, the record is processed against the operation statements designated by the user. Operation statements are generally expressed in the standard IF/ELSEIF/ELSE block and COMP statements. These and other operations available to the user are described in Control statements. In the NODEMERGE phase, a node record is processed for each unique node from the NODEI files. If a node is re-coded in the INPUT phase, the re-coded node number is included. In the LINKMERGE phase, a link record is processed for each unique link found from the LINKI files. If a link is recoded in the INPUT phase, the recoded link is included.

Network Topology Functions

This section describes in detail the network topology functions available in NETWORK Program.

  • _N.MaxConnect - Maximum number of connections for any node in the entire network.

  • _N.Connections - Get number of connecting nodes to N.

  • _N.Legs - Get number of legs at N.

  • _N.Inbounds - Get number of inbound links to N.

  • _N.Outbounds - Get number of outbound links to N.

  • _NI._Angle[#] - Get inbound link angle in degrees, # is the leg number.

  • _NO._Angle[#] - Get outbound link angle in degrees, # is the leg number.

  • _NI._R_ANGLE[#] - Get inbound link angle relative to the current leg, in degrees.

  • _NO._R_ANGLE[#] - Get outbound link angle relative to the current leg, in degrees.

  • _L.S_Angle - Get link angle for the current link, at the start of the link.

  • _L.E_Angle - Get link angle for the current link, at the end of the link.

  • _A.Connections/_B.Connections - Get number of connecting nodes to A/B. Refer to _N.Connections.
  • _A.Legs/_B.Legs - Get number of legs at A/B. Refer to _N.Legs.
  • _A.Inbounds/_B.Inbounds - Get number of inbound links at A/B. Refer to _N.Inbounds.
  • _A.Outbounds/_B.Outbounds - Get number of outbound links at A/B. Refer to _N.Outbounds.
  • _A.CurrentLeg/_B.CurrentLeg - Get the leg number of the current link at A/B.

  • _AI._Angle[#]/_BI._Angle[#] - Get inbound link angle in degrees, [#] is the leg number at A/B. Refer to _NI._Angle[#].
  • _AO._Angle[#]/_BO._Angle[#] - Get outbound link angle in degrees, [#] is the leg number at A/B. Refer to _NO._Angle[#].
  • _AI._R_ANGLE[#]/_BI._R_ANGLE[#] - Get inbound link angle relative to the current link. Refer to _NI._R_Angle[#].
  • _AO._R_ANGLE[#]/_BO._R_ANGLE[#] - Get outbound link angle relative to the current link, in degrees. Refer to _NO._R_Angle[#].
  • _AI._MOVE[#]/_BI._MOVE[#] - Get the movement number of an inbound leg relative to the current leg. The movement number is the direction from which a leg is approaching the current leg. The direction angles are calculated as relative angles from the current leg. The below table shows the movement number, the angles for the movement number, the direction from which the leg is approaching from and the corresponding turn movement.
Movement

Number

Angle Direction (leg is approaching from) Turn Movement
1 45 to 135 degrees RIGHT LEFT
2 135 degree to 225 degrees STRAIGHT THROUGH
3 225degrees to 315 degrees LEFT RIGHT
4 0-45 and 315-360 degrees RIGHT U-TURN

A movement number of 0 means the leg being considered is the current leg.

  • _AO._MOVE[#]/_BO._MOVE[#] - Get the movement number of an outbound leg relative to the current leg. The movement number is the direction to which, a leg is departing the current leg. The direction angles are calculated as relative angles from the current leg. The below table shows the movement number, the angles for the movement number, the direction from which the leg is approaching from and the corresponding turn movement.

Movement

Number

Angle

Direction (leg is

approaching from)

Turn Movement

1

45 to 135 degrees

RIGHT

RIGHT

2

135 degree to 225 degress

STRAIGHT

THROUGH

3

225 degree to 315 degrees

LEFT

LEFT

4

0-45 and 315-360 degrees

REVERSE

U-TURN

A movement number of 0 means the leg being considered is the current leg.

  • _A.MAXMOVELEGS/_B.MAXMOVELEGS - Variable which contains the highest number of legs per movement, in both inbound and outbound direction at the A/B node.

Variable referencing

The main logic of the program involves processing variables. A variable name may be up to 15 characters in length, and may consist of only letters, digits, and the underscore character. The first character of the name may not be a digit. If the first character of a name is an underscore (_), the variable is only a local working variable, and will not be included in the network. Variables are usually classified as either node or link based. Classification depends upon the process phase in which the variable is referenced. If a new variable is computed (NEWVAR=…), it will be attached as either a node or link variable. During any INPUT phases, the variables will be associated with the type of file being processed. During the NODEMERGE phase, the variables are node based. During the LINKMERGE phase, variables are link based, but node variables can be referenced. A node variable is referenced during LINKMERGE as either A.name or B.name.

If a variable from an input file is to be referenced during NODEMERGE or LINKMERGE, the associated NODEI or LINKI file number must precede the variable name. For NODEMERGE the prefix is NI.#., and for LINKMERGE the prefix is LI.#. For example: LI.3.ABC references the variable ABC from the LINKI[3] file. The program establishes a buffer for a record from each input file for every record in the phase, and the prefix allows access to each of those buffers. If there is no input record for the current working record, the values are all zero. The formal designation for the prefix is LI.#., but the program allows the following variations:

For node records: NI.#.name* NI#.name N.#.name N#.name For link records: LI.#.name* LI#.name L.#.name L#.name

*The preferred method of designation.

Another type of variable is the working variable. Working variables are variables that are to be used for intermediate storage, and will not be part of an output network. They are distinguished by their first letter, which must be an underscore. Working variables are set to zero at the beginning of the application, and are changed only by user statements. If there is a user SUMMARY phase, every variable referenced within the SUMMARY block is a working variable, unless it is the same as a link variable. If it matches a link variable, the variable from the last link will be processed. Working variables allow the user to accumulate statistics during link processing, and to then compute and print summaries at the end of processing.

Note: In some situations, a PRINT LIST variable may not be recognized if it is cross-referenced. For example: LIST=A,B,A.X,B.X may not be accepted. To be sure, node based variables to be listed should be set into temporary variables and then listed with that name. (See Examples and FAQ for an illustration.)

Example

_vdiff = L1.vol - L2.vol; get assignment differences
_vcnt = _vcnt + 1
if (_vdiff != 0) _sumsqdiff = _sumsqdiff + _vdiff*_vdiff
.
.
Phase=SUMMARY
    if (_vcnt > 1)
        RMSV = sqrt(_sumsqdiff / _vcnt); possibly (_vcnt-1)
        list = 'RMSV =', RMSV
    endif
Phase=LINKMERGE
    _ax = a.x ; get the Node variable named X for Node A
    _ay = a.y
    LIST=a,b,_ax,_ay
EndPhase

Output variables

During the merge phases, a work record is generated for each unique record that appears in all the input files (depending upon the value of the MERGE RECORD keyword). Each work record will contain all the unique variables that are defined in/for all the input files and any COMP statements for the phase. The value that is stored for each variable is controlled by the MERGE control statement. If all the variables are not to be included in the output network, the variable list can be modified on the FILEO statement.

Plotting

The network that is formed during the LINKMERGE phase can be plotted by sending information to a standard Windows printer device. There must be an appropriate printer device driver for the media where the network is to be plotted. Typical types of drivers are available for printers, faxes, raster plotters, and pen plotters. The Network program uses the Windows driver to perform the actual formatting of the network information. Many default drivers come with Windows and provide considerable capabilities. This process provides for current and future flexibility. It is possible to directly fax a network plot to a facsimile machine. Windows operating systems are geared towards more recent technology, so pen plotters are being left somewhat behind. They do cause some problems.

Pen plotter problems: The standard Windows drivers for pen plotters do not seem to function properly; in particular, they do not always write text at the proper location and angle. There are third- party software drivers available that correct this problem, but deficiencies have been reported in these systems, as well. With one driver (WinPlus), if legends are used, the link posting will be oriented properly, but mis-positioned. This release of the program does not address these driver deficiencies; perhaps later versions will internally rectify them. Plotting pens are selected by RGB (RedGreenBlue) standards, so it becomes the responsibility of the user to ensure that the colors that are selected correspond with the pens on the plotter. If standard colors are used (red, green, blue, yellow, etc.), there should be no problems. If esoteric colors are requested, color correspondence is not guaranteed. If roll size is selected in the device driver, the program may not be able to properly scale the plot. In those cases, the user must specify the desired plate size.

It is recommended that if pen plotters are to be used that the WinPlus driver be obtained and installed as a printer driver and that the PLOTTER statement contains no LEGEND keywords.

A PLOTTER control statement is used to define the plotting system and the parameters for performing the plot. PLOT statements processed during LINKMERGE determine what will be plotted from the network. If there are PLOT statements, but no PLOTTER statement, the program will fatally terminate; the opposite is not an error. The PLOTTER statement contains information about:

The plotting device name, and whether the output is to be sent directly to the plotting device, or to a file.

The logical layout of the plot plate on a sheet of the plotter device: the desired size, if different than the driver provided size, and the margins to place the plate within the driver provided dimensions.

  • The optional network window for selection, and optional scaling.
  • The headers and footers to be printed on the plot.
  • Legends that can be displayed in the corners of the plotting window.
  • The link variables that are to be posted when a link is selected for posting.
  • The node variables that are to be posted, when a node is selected for posting.
  • Bandwidths and type of fill and end tapers.

In general, all text that is to be plotted can have its font, color and size specified by the user. The default values for each of these are: ARIAL, black, 0.10. All sizes are specified in inches, so that if a different driver is used, the text would still be readable. Link posting (writing text along a link) can not be varied by link; if a link is posted, its posting will contain the same type of information at the same size and font as any other link that is posted. The user controls the color of link posts; individual variables can not be colored differently. Node posting (writing text near a node) will always post the same variables, but the size and color is controlled by PLOT statements.

Before performing a plot, the device driver must be properly installed. This is done by left clicking the Windows Start button and choosing Printers and Faxes. In the Printers and Faxes window, click Add a printer and follow standard installation processes. The orientation of the plot, (portrait, landscape) is set in the device. If a device is not attached directly to the computer, the driver should have the file option specified, and the PLOTTER DEVICE FILE value (filename) should be specified. Files are generally processed by copying them directly to the plotter port.

PLOT statements control actual plotting. If a PLOT statement is processed in LINKMERGE, the current link is flagged for processing by the plotting process. The following processes are considered:

  • DrawLink - Draw the link as specified.
  • LinkPost - Post variables for the link.
  • DrawA - Draw a specified symbol for the Anode of the link.
  • NodePost - Post variables at the A node.

These values can be specified multiple times for each link; the values that are current at the end of the link are used for plotting. For node processing, the values that are current following the last link outbound from a node are used. If the PLOT statement is invoked by the use of one of these trigger keywords, it may be placed on a short IF statement. Example: IF (...) DrawLink=red, LinkPost=red.

If a keyword specifies plotting, but then later conditions determine that it should not really be plotted, the keyword can be nullified by setting its value to -1. Example: NodePost=-1.

Many times a link posting may be too long for the link. You can deal with these situations by specifying the fourth value for PLOTTER POSTLINKVAR FONT.